cmake_minimum_required(VERSION 2.6.2)

# Use relative paths
# This is mostly to reduce path size for command-line limits on windows
if(WIN32)
  # This seems to break Xcode projects so definitely don't enable on Apple builds
  set(CMAKE_USE_RELATIVE_PATHS true)
  set(CMAKE_SUPPRESS_REGENERATION true)
endif()

project(freemind_rt)

# Include necessary submodules
set(CMAKE_MODULE_PATH 
	"${PROJECT_SOURCE_DIR}/CMake/Packages"
	"${PROJECT_SOURCE_DIR}/CMake/cuda"
	"${PROJECT_SOURCE_DIR}/CMake"
	"${PROJECT_SOURCE_DIR}/CMake/Utils"
)

include(FindCUDA)
include(FindOGRE)
include(FindOIS)

# Find dependencies
find_package(OGRE REQUIRED)
	# OGRE include path
	set(DEPENDENCIES_OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
	# OGRE library link
	set(DEPENDENCIES_OGRE_LIBRARY ${OGRE_LIBRARY})
	
find_package(OIS REQUIRED)
	# OIS include path
	set(DEPENDENCIES_OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS})
	# OIS library link
	set(DEPENDENCIES_OIS_LIBRARY ${OIS_LIBRARIES})
	
find_package(CUDA REQUIRED)
	set(DEPENDENCIES_CUDA_INCLUDE_DIR ${CUDA_INCLUDE_DIRS} ${CUDA_CUT_INCLUDE_DIR})
	set(DEPENDENCIES_CUDA_LIBRARY ${CUDA_LIBRARIES} ${CUDA_CUT_LIBRARIES})
	
	
# dependencies include path
set(DEPENDENCIES_INCLUDE_DIR ${DEPENDENCIES_OGRE_INCLUDE_DIR} ${DEPENDENCIES_OIS_DIR} ${DEPENDENCIES_CUDA_INCLUDE_DIR})
# dependencies library links
set(DEPENDENCIES_LIBRARY ${DEPENDENCIES_OGRE_LIBRARY} ${DEPENDENCIES_OIS_LIBRARY} ${DEPENDENCIES_CUDA_LIBRARY})

# Set include path
set(KDSM_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/kdtree_scene_manager/include)
set(CUDA_TEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cuda_test/include)

# Set build path
set(RT_BUILD_DIR ${PROJECT_BINARY_DIR})

add_subdirectory(cuda_test)
add_subdirectory(rt_main)
#add_subdirectory(kdtree_scene_manager)

#add_subdirectory(docs)



